var webpage = require('webpage').create();
var path = 'd:/slimerjsout/16_1';


webpage.onConsoleMessage = function (msg, lineNum, sourceId, level, func, timestamp) {
    var out = msg.split(' ');
    if (out[1] >= 10) {
        slimer.exit()
    }
    webpage.render(path + '/' + out[0] + '.png',
        {onlyViewport: true});
}
//15级  0-20
//16级   0-83
//17级   0-331
webpage
    .open('http://minedata.cn/application/xpx/cut/test_pixel_slimerjs.html#4494;16;5') // loads a page
    .then(function () { // executed after loading
        // store a screenshot of the page
        webpage.viewportSize =
            {width: 512, height: 512};
    });